package com.baiduspring.dao.entity;

import lombok.Data;

import java.util.Objects;

@Data
public class VirtualNumber {
    private Long id;

    private Long minValue;

    private Long maxValue;

    private Long currentValue;

    private Long updateDate;

    public VirtualNumber update() {
        if (Objects.isNull(this.currentValue)) {
            setCurrentValue(this.minValue);
        }
        this.setUpdateDate(System.currentTimeMillis());
        return this;
    }
}